package org.wzy.springcloud.feign.fallback;

import org.springframework.stereotype.Component;
import org.wzy.springcloud.feign.api.base.BaseLogger;
import org.wzy.springcloud.feign.api.domain.Person;
import org.wzy.springcloud.feign.api.service.PersonService;

import java.util.Collection;
import java.util.Collections;

/**
 * @author wzy_h
 * @version 1.0
 * @date 22:08 2017/11/24
 * @description
 */
//@Component
public class PersonServiceFallBack extends BaseLogger implements PersonService {

    @Override
    public String save(Person person) {
        LOGGER.error("===> 进入PersonServiceFallBack类中...... save occurs error, will return false person={}", person);
        return "触发熔断... save 失败";
    }

    @Override
    public Collection<Person> findAll() {
        LOGGER.error("===> 进入PersonServiceFallBack类中...... findAll occurs error, will return empty List");
        return Collections.emptyList();
    }
}
